﻿@namespace SE.PO.CInterface.Web.Pages.DB.Signal
@using SE.PO.CInterface.Web.Clients
@inject SignalClient Client
@using SE.PO.CInterface.Web.Pages.DB.Components
@using SE.PO.CInterface.Enums
@inject INotificationService Notice
<Row Gutter="24">
    <GridCol Span="6">
        <Form
            Model="@Model"
            Style="margin-top: 8px;"
            OnFinish="OnFinish"
            OnFinishFailed="OnFinishFailed"
            Class="ant-advanced-search-form"
            @ref="@Form">

            <FormItem Label="下级SCID" LabelCol="_formItemLayout.LabelCol" WrapperCol="_formItemLayout.WrapperCol">
                <Input Placeholder="SC编码，下级SCID" style="width: 220px;" @bind-Value="@context.ScId"/>
            </FormItem>

            <FormItem Required Label="站点" LabelCol="_formItemLayout.LabelCol" WrapperCol="_formItemLayout.WrapperCol">
                <SelectSite Model="@Model"></SelectSite>
            </FormItem>
            @* 设备类型、测量类型、监控信息、数据类型 *@
            <SelectSignalCoding @ref="_selectSignalCodingComponent"
                                SelectDeviceTypeChanged="async (s) => { await GetDeviceSourceByTypeAsync(s); }"
                                SelectMonitorItemChanged="async (s) => { await RefreshVariableOrderAsync(s); }">
            </SelectSignalCoding>
            <FormItem Required Label="数据类型" LabelCol="_formItemLayout.LabelCol" WrapperCol="_formItemLayout.WrapperCol">
                <EnumSelect style="width: 220px;" TEnum="Enums.Type" @bind-Value="@context.Type"/>
            </FormItem>

        </Form>
    </GridCol>
    <GridCol Span="8">
        <SelectDevices @ref="_selectDevicesComponent"></SelectDevices>
    </GridCol>
    <GridCol Span="10">
        <SelectVariables @ref="_selectVariablesComponent" SelectSignalCoding="@_selectSignalCodingComponent" SelectDevices="@_selectDevicesComponent"></SelectVariables>
    </GridCol>
</Row>